#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
LL arr[N];
int n;

int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	LL ma = -1e9;
	int idx = 0;
	for (int i = 1, d = 1; i <= n; i *= 2, d++) {
		LL s = 0;
		for (int j = i; j < i + (1 << (d - 1)) && j <= n; j++) {
			s += arr[j];
		}
		//	cout<<s<<endl;
		if (s > ma) {
			ma = s;
			idx = d;
		}
	}
	cout << idx << endl;
	return 0;
}